package tk.leafotto.ssm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.leafotto.ssm.beans.AlertInfo;
import tk.leafotto.ssm.dao.AlertInfoMapper;

import java.util.List;

@Service
public class AlertInfoService {
    @Autowired
    AlertInfoMapper alertInfoMapper;
    public List<AlertInfo> getAlertInfo(){
        return alertInfoMapper.getAlertInfo();
    }

    public List<AlertInfo> getAlertNoConfirm(){
        return alertInfoMapper.getAlertNoConfirm();
    }

    public List<AlertInfo> selectAlertInfo(int id){
        return alertInfoMapper.selectAlertInfo(id);
    }

    public int putAlertInfo(AlertInfo alertInfo) {
        alertInfoMapper.putAlertInfo(alertInfo);
        return alertInfo.getId();
    }

    public int confirmalert(AlertInfo alertInfo) {
        return alertInfoMapper.confirmalert(alertInfo);
    }

    public List<AlertInfo> getAlertDetail(int camid, Long alertTimeStart, Long alertTimeEnd, int confirmstate, int confirmuser, Long confirmTimeStart, Long confirmTimeEnd, String remarks, int startRow, int limitRow, String orderBy, int desc){
        return alertInfoMapper.getAlertDetail(camid, alertTimeStart, alertTimeEnd, confirmstate, confirmuser, confirmTimeStart, confirmTimeEnd, remarks, startRow, limitRow, orderBy, desc);
    }
}
